#define USE_CRT_SECURE_NO_WARNINGS 1 
#include <stdio.h>
int main()
{
	int N = 0;
	char arr[14] = { 0 };
	int i = 0;
	int k = 0;
	scanf_s("%d", &N);
	while (N)
	{
		if (k != 0 && k % 3 == 0)
		arr[i++] = ',';
		arr[i++] = N % 10 + '0';
		N = N / 10;
		k++;
	}
	for (i--; i >= 0; i--)
	{
		printf("%c", arr[i]);
	}

	return 0;
}